// @ts-ignore
/* eslint-disable */
import request from '@/request'

/** 发送验证码 发送邮箱验证码 POST /common/captcha */
export async function captcha(body: API.EmailDTO, options?: { [key: string]: any }) {
  return request<API.BaseResponseString>('/common/captcha', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 删除文件 从OSS删除文件 DELETE /common/file */
export async function deleteFile(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteFileParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>('/common/file', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 上传文件 上传文件到OSS POST /common/upload */
export async function uploadFile(body: {}, options?: { [key: string]: any }) {
  return request<API.BaseResponseString>('/common/upload', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 上传图片 上传图片到OSS（包含格式校验） POST /common/upload/image */
export async function uploadImage(body: {}, options?: { [key: string]: any }) {
  return request<API.BaseResponseString>('/common/upload/image', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}
